package com.dhcc.core.components.httpClient.model.exception;

public class HttpClientException extends RuntimeException {

	
	/**
     * @fieldName: serialVersionUID
     * @fieldType: long
     * @Description: TODO
     */
    private static final long serialVersionUID = 1L;

    public HttpClientException(String message, Throwable cause) {
		super(message, cause);
	}	
	
	public static final HttpClientException unwrap(Throwable cause) {
		
		if (cause == null) {
			return new HttpClientException("error.httpclient", cause);
		
		} else if (cause instanceof HttpClientException) {
			return (HttpClientException) cause;
			
		} else {
			return new HttpClientException(cause.getMessage(), cause);
			
		}
		
	}

}
